<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8" />
<title>订单管理 - 查看积分订单</title>
<?php include($this->c['_homes']['_viewsHome'].'/_global/_head.php');?>
</head>
<!-- BEGIN BODY -->
<body class="page-header-fixed page-sidebar-fixed">
<!-- BEGIN HEADER -->
<?php include($this->c['_homes']['_viewsHome'].'/_global/head.php');?>
<!-- END HEADER -->
<div class="clearfix"></div>
<!-- BEGIN CONTAINER -->
<div class="page-container" > 
  <!-- BEGIN HORIZONTAL MENU PAGE SIDEBAR1 -->
  <?php include($this->c['_homes']['_viewsHome'].'/_global/menu.php');?>
  <!-- END BEGIN HORIZONTAL MENU PAGE SIDEBAR --> 
  <!-- BEGIN PAGE -->
  <div class="page-content"> 
    <!-- BEGIN PAGE HEADER-->
    <div class="row">
      <div class="col-md-12"> 
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title"> 查看积分订单 </h3>
        <ul class="page-breadcrumb breadcrumb">
          <li> <i class="icon-home"></i> <a href="/manage">后台</a> <i class="icon-angle-right"></i> </li>
          <li> 订单管理 <i class="icon-angle-right"></i> </li>
          <li> <a href="/order/jifen">积分订单</a> <i class="icon-angle-right"></i> </li>
          <li>查看积分订单</li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB--> 
      </div>
    </div>
    <!-- END PAGE HEADER--> 
    <!-- BEGIN PAGE CONTENT-->
    
    <div class="row">
      <div class="col-md-12"> 
        <!-- BEGIN SAMPLE FORM PORTLET-->
        <form class="form-horizontal" id="_frm" method="post" action="/order/savejifen" onSubmit="return chkfrm();">
          <input type="hidden" name="act" id="_act" value="">
          <input type="hidden" name="order_id" value="<?=$this->data['order_id'];?>">
          <div class="tabbable tabbable-custom boxless">
          <div class="tab-content"> 
            <!--Tab0-->
            <div class="tab-pane active" id="tab_0">
              <div class="portlet box blue ">
                <div class="portlet-title">
                  <div class="caption"> <i class="icon-reorder"></i> 基本信息 </div>
                </div>
                <div class="portlet-body form">
                  <div class="form-body">
                    <div class="form-group">
                      <label  class="col-md-2 control-label">订单号</label>
                      <div class="col-md-9">
                        <h5>
                          <?=$this->data['order_id'];?>
                        </h5>
                      </div>
                    </div>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">创建时间</label>
                      <div class="col-md-9">
                        <h5>
                          <?=date("Y-m-d H:i:s",$this->data['add_time']);?>
                        </h5>
                      </div>
                    </div>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">兑换积分</label>
                      <div class="col-md-9">
                        <h5>
                          <?=$this->data['jifen'];?>
                        </h5>
                      </div>
                    </div>                    
                    <div class="form-group">
                      <label  class="col-md-2 control-label">订单状态</label>
                      <div class="col-md-9">
                        <h5>
                          <?=$this->c['stat']['jifen_order'][ $this->data['stat'] ];?>
                        </h5>
                      </div>
                    </div>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">发货状态</label>
                      <div class="col-md-9">
                        <?php
						if($this->data['stat']==2 || $this->data['stat']==3){
							echo '<strong>发货信息</strong><br>快递公司：'.$this->data['shipping_name'].'<br>快递单号：'.$this->data['shipping_id'];	
						}else echo '--';					
						?>
                      </div>
                    </div>                    
                    <hr>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">收货人</label>
                      <div class="col-md-6">
                        <h5>
                          <?=$this->data['consignee'];?>
                        </h5>
                      </div>
                    </div>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">联系电话</label>
                      <div class="col-md-6">
                        <h5>
                          <?=$this->data['tel'];?>
                        </h5>
                      </div>
                    </div>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">收货地址</label>
                      <div class="col-md-6">
                        <h5>
                          <?=$this->data['address'];?>
                        </h5>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <!--Tab1-->
            <div class="tab-pane active" id="tab_1">
              <div class="portlet box blue ">
                <div class="portlet-title">
                  <div class="caption"> <i class="icon-reorder"></i> 商品信息 </div>
                </div>
                <div class="portlet-body">
                  <div class="table-scrollable">
             <table class="table table-striped table-bordered table-hover dataTable">
                      <thead>
                        <tr>
                          <th>商品ID</th>
                          <th>商品名称</th>
                          <th>数量</th>
                        </tr>
                      </thead>
                      <tbody>                        
                        <tr>
                          <td><?=$this->data['goods_id'];?></td>
                          <td><?=$this->data['goods_name'];?></td>
                          <td>1</td>                          
                        </tr>
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
            </div>
            <?php
			if($this->data['stat']<3){
			?>
            <!--Tab2-->
            <div class="tab-pane active" id="tab_2">
              <div class="portlet box blue ">
                <div class="portlet-title">
                  <div class="caption"> <i class="icon-reorder"></i> 订单操作</div>
                </div>
                <div class="portlet-body form">
                  <div class="form-body">
                    <div class="form-group">
                      <label class="col-md-2 control-label">快递公司</label>
                      <div class="col-md-6">
                        <input type="text" name="shipping_name" id="_shipping_name" maxlength="30" class="form-control" value="">
                        <span class="help-block">例如：圆通快递</span> </div>
                    </div>
                    <div class="form-group">
                      <label class="col-md-2 control-label">快递单号</label>
                      <div class="col-md-6">
                        <input type="text" name="shipping_id" id="_shipping_id" maxlength="30" class="form-control" value="">
                        <span class="help-block">请填写正确的快递单号</span> </div>
                    </div>
                    <div class="form-group">
                      <label class="col-md-2 control-label">备注信息</label>
                      <div class="col-md-6">
                        <textarea name="comment" class="form-control" rows="3"></textarea>
                      </div>
                    </div>
                    <hr>
                    <div class="form-group">
                      <label  class="col-md-2 control-label">可执行操作</label>
                      <div class="col-md-9">
                        <button class="btn green" onClick="_set_act('beihuo');">设为备货中</button>
                        <button class="btn blue" onClick="_set_act('shipping');">设为发货</button>
                        <button class="btn green" onClick="_set_act('received');">设为已收货</button>
                        <button class="btn red" onClick="_set_act('cancel');">取消订单</button>
                      </div>
                    </div>                                     
                  </div>
                </div>
              </div>
              <!--End Tab--> 
            <?
			}
			?>
            </div>
          </div>
        </form>
        <!-- END SAMPLE FORM PORTLET--> 
      </div>
    </div>
    <!-- END PAGE CONTENT--> 
  </div>
  <!-- END PAGE --> 
</div>
<!-- END CONTAINER -->
<?php include($this->c['_homes']['_viewsHome'].'/_global/_footer.php');?>
<script>
jQuery(document).ready(function() {    
   App.init();	
});

function _set_act(act)
{
	$("#_act").prop("value",act);
	
}

function chkfrm()
{
	var _act = $("#_act").prop("value"),cm = false;
	
	switch(_act){
		case "shipping":			
			if( $("#_shipping_name").prop("value")==""){
				alert("请填写快递公司名称");
				$("#_shipping_name").focus();
				return false;	
			}
			
			if( $("#_shipping_id").prop("value")==""){
				alert("请填写快递单号");
				$("#_shipping_id").focus();
				return false;	
			}
			
			cm = confirm("确定发货？");
			break;		
		case "beihuo":
			cm = confirm("确定设为备货中？");
			break;
		case "received":
			cm = confirm("确定设为已收货？");
			break;
		case "cancel":
			cm = confirm("确定取消订单？");
			break;
	}
	
	if(!cm) return false;
}
</script> 
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>